package com.sxyjhh.dbutil.utils;


import lombok.extern.log4j.Log4j;

import java.io.InputStream;
import java.util.Properties;

/**
 * 资源加载类
 * Created by wangchun on 2016/4/19.
 */
@Log4j
public class ResourceLoader {

    Properties properties = null;

    public ResourceLoader(String resourcesPath) {
        InputStream input = getClass().getClassLoader().getResourceAsStream(resourcesPath);
        properties = new Properties();
        try {
            properties.load(input);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("ResourceLoader error",e);
        }
    }

    public String getPropertiesValue(String keyName){
        return (String) properties.get(keyName);
    }

}
